import request from '@/utils/request'
import qs from 'qs'
export function commodityList(params) {
    return request({
      url: '/operate/operations/queryOperationProInfo',
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      },
      method: 'get',
      data: params,
    params: {
        pageNum: params.pageNum,
        pageSize: params.pageSize,
        proCode: params.proCode,
        goodsBrand: params.goodsBrand,
        // pageConvert: params.pageConvert
        infoName:params.infoName,
        catId: params.catId
    }
    })
  }
  export function getSearchList() {
    return request({
      url: '/operate/proInfos/findClassifyByName',
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      },
      method: 'post',
    })
  }
  /**
   * image_url 商品主图
   * bf1 商品详情图
   * pro_pic_url 商品轮播图
   * @param {Object} proId
   * @description 获取商品详情 相关图片
   *
   */
  export function getImg1(proId) {
    return request({
      url: '/operate/operations/queryProInfoAndProDesc/'+proId,
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      },
      method: 'get',
    })
  }
  export function updataImg(params) {
    return request({
      url: '/operate/operations/updateProInfo',
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      },
      method: 'get',
      data:params
    })
  }
  export function addImg(data) {
    return request({
      url: '/operate/uploadImgUrl',
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      method: 'post',
      data
    })
  }

  export function updateImg(params) {
    return request({
      url: '/operate/operations/updateProInfo',
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      },
      method: 'post',
      data:params
    })
  }
  /**
   * 此方法有bug 调用ids
   * @param {Object} params
   */
  export function delImg(params) {
    return request({
      url: '/ids/pub/file/deleteFile?fileName='+data,
      headers: {
        'Content-Type': 'application/json'
      },
      method: 'post',
      //data: qs.stringify(data)
    })
  }

  /**
   * 此方法无用
   * @param {Object} params
   */
  export function delDetailsImg(params) {
    return request({
      url: '/ids/pub/file/deleteFile?fileName='+data,
      headers: {
        'Content-Type': 'application/json'
      },
      method: 'post',
      //data: qs.stringify(data)
    })
  }
